Remove orphaned senate/Triumvirate dead code from SDK#3294
Closed
dev-miro26 wants to merge 1 commit intoopentensor:masterfrom
Closed
Remove orphaned senate/Triumvirate dead code from SDK#3294dev-miro26 wants to merge 1 commit intoopentensor:masterfrom
dev-miro26 wants to merge 1 commit intoopentensor:masterfrom
Conversation
…cSubtensor and Subtensor classes, along with related tests and imports, to clean up deprecated code.
Author
|
Hi, @thewhaleking @basfroman |
Contributor
See #3283 (comment) Also this is the same PR as #3283 |
Author
|
@thewhaleking |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #3282
Description of the Change
The senate/Triumvirate pallet was removed from the subtensor runtime, but the Python SDK still contained orphaned code referencing it. This PR removes all dead code tied to the
Triumviratepallet'sVotingstorage:get_vote_data()fromSubtensorandAsyncSubtensorProposalVoteDatadataclass and its module (proposal_vote_data.py)ProposalVoteDataexports fromchain_data/__init__.pyandeasy_imports.pyget_vote_datawiring fromChainAPI wrappertest_async_subtensor.pyProposalVoteDataimport and ~200 lines of commented-out senate tests fromtest_delegate.pypropose,async_propose,vote, andasync_voteTriumvirate helpers from e2e test utilsThe deprecated
ProxyTypeenum entries (Triumvirate,Senate,Governance,RootWeights) are intentionally kept for backward compatibility with historical on-chain proxy data.Alternate Designs
A deprecation wrapper that raises
NotImplementedErrorwas considered, but sinceget_vote_data()already silently returnsNoneor errors at the substrate level against the current chain, a clean removal is the safer and simpler path.Possible Drawbacks
Any third-party code importing
ProposalVoteDataor callingget_vote_data()will break at import/call time. This is the desired behavior — failing loudly is preferable to silently returningNonefrom a non-existent pallet.Verification Process
get_vote_data,ProposalVoteData, orproposal_vote_datain the codebase via project-wide searchTriumvirate/Senatereferences are the deprecatedProxyTypeenum values and a docstring incoldkey_swap.pyRelease Notes
Removed dead senate/Triumvirate code (
get_vote_data,ProposalVoteData) left over from the pallet's removal from the subtensor runtime.Branch Acknowledgement
[x] I am acknowledging that I am opening this branch against
staging